<template>
  <el-dialog
    v-bind="$attrs"
    v-on="$listeners"
    :visible="visible"
  >
    <slot></slot>
    <div slot="footer">
      <el-button v-if="cancelText" @click="$emit('on-cancel')">{{cancelText}}</el-button>
      <el-button v-if="okText" type="primary" @click="$emit('on-ok')">{{okText}}</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'ex-modal',
  props: {
    /**
     * 弹框可见状态
     */
    visible: {
      type: Boolean,
      default: false
    },
    /**
     * 确定按钮的文本
     */
    okText: {
      type: String,
      default: '确定'
    },
    /**
     * 取消按钮的文本
     */
    cancelText: {
      type: String,
      default: '取消'
    }
  },
  data () {
    return {
      
    }
  },
  methods: {

  }
}
</script>
